package nl.hanze.designpatterns.Controllers;

import nl.hanze.designpatterns.Domain.TroubleTicket;
import nl.hanze.designpatterns.Models.MainModel;
import nl.hanze.designpatterns.Views.MainScreen;

/**
 *
 * Created by Aron on 24-9-2014.
 */
public class TicketController {

    private MainModel mainModel;
    private MainScreen mainScreen;

    public TicketController(MainScreen mainScreen, MainModel mainModel) {
        this.mainScreen = mainScreen;
        this.mainModel = mainModel;
    }

    public void logout() {
        System.out.println("[LOGOUT]");
        this.mainModel.logout();
        mainScreen.changeView("login");
    }

    public void newTicket() {
        mainModel.newTicket();
    }

    public void saveTicket() {
        mainModel.saveTicket();
    }

    public void selectTicket(TroubleTicket troubleTicket) {
        mainModel.selectTicket(troubleTicket);
    }

    public void toQnA() {
        mainScreen.changeView("QnA");
    }
}
